// Learn cc.Class:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
// Learn Attribute:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
// Learn life-cycle callbacks:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html

/*
 *投注球通用
*/
cc.Class({
    extends: cc.Component,

    properties: {
        labDec: cc.Label,  //球正常时数字
        labSelDec:cc.Label,  //球选中时数字
        labMiss:cc.Label,  //遗漏时数字
        ballType:0, //0正常1红色2黄色

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },

    init: function(data) {
        this.labDec.string = data.num;
        this.labSelDec.string = data.num;
        this.setMissNum(data.miss)
    },

    //设置球数字颜色
    setNumColor:function(color){
        this.labDec.node.color = color;
    },

    //设置遗漏
    setMissNum:function(miss){
        if( miss == "" && miss != 0)
        {
            this.labMiss.node.active = false;
        }
        else
        {
            this.labMiss.node.active = true;
            this.labMiss.string = miss;
        }
    },

    //设置文字
    setNum:function(num){
        this.labDec.string = num;
    },

    //得到文字
    getNum:function(){
        return this.labDec.string;
    },

    //设置类型
    setType:function(type){
        this.ballType = type;
    },

    //得到球类型
    getType:function(){
        return this.ballType;
    },

    // update (dt) {},
});
